<?php
Class Donors_model extends CI_Model {

  //Saves an user into the database
  function save($donorid, $donorname, $donortel, $donormail, $donorcountry, $donordir) {
	  $sql = "Save_Donor '$donorid', '$donorname', '$donortel', '$donormail', '$donorcountry', '$donordir'"; 
    $query = $this->db->query($sql);
    return $query->num_rows();
  }

  function getalldonors() {
    $sql = "SELECT id_donador, ds_donador FROM Donadores";
    $query = $this->db->query($sql);
    return $query->result();
  }

  function getdonorbyid($id) {
    $sql = "Search_Donor '$id'";
    $query = $this->db->query($sql);
    return $query->result();
  }

}
?>